package com.yulongtian.oneProblemEveryDay.month202302;

/**
 * https://leetcode.cn/problems/best-poker-hand/
 * 可
 *
 * @author yulongTian
 * @create 2023-02-20 9:57
 */
public class Test17 {
    public static void main(String[] args) {

    }


    public static String bestHand(int[] ranks, char[] suits) {
        //是否为同花
        boolean flag1 = true;
        for (int i = 1; i < suits.length; i++) {
            if (suits[i] != suits[i - 1]) {
                flag1 = false;
            }
        }
        if (flag1) {
            return "Flush";
        }

        //判断三条
        int[] three = new int[14];
        for (int i = 0; i < ranks.length; i++) {
            three[ranks[i]]++;
            if (three[ranks[i]] >= 3) {
                return "Three of a Kind";
            }
        }

        for (int i : three) {
            if (i >= 3) {
                return "Three of a Kind";
            }
            if (i == 2) {
                return "Pair";
            }
        }
        return "High Card";
    }


}
